/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package ria.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import ria.HSlider;
import ria.RiaPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>HSlider</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link ria.impl.HSliderImpl#getMinimum <em>Minimum</em>}</li>
 *   <li>{@link ria.impl.HSliderImpl#getMaximum <em>Maximum</em>}</li>
 *   <li>{@link ria.impl.HSliderImpl#getSnapInterval <em>Snap Interval</em>}</li>
 *   <li>{@link ria.impl.HSliderImpl#getTickInterval <em>Tick Interval</em>}</li>
 *   <li>{@link ria.impl.HSliderImpl#isLiveDragging <em>Live Dragging</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class HSliderImpl extends WInputImpl implements HSlider {
	/**
	 * The default value of the '{@link #getMinimum() <em>Minimum</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMinimum()
	 * @generated
	 * @ordered
	 */
	protected static final int MINIMUM_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getMinimum() <em>Minimum</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMinimum()
	 * @generated
	 * @ordered
	 */
	protected int minimum = MINIMUM_EDEFAULT;

	/**
	 * The default value of the '{@link #getMaximum() <em>Maximum</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaximum()
	 * @generated
	 * @ordered
	 */
	protected static final int MAXIMUM_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getMaximum() <em>Maximum</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMaximum()
	 * @generated
	 * @ordered
	 */
	protected int maximum = MAXIMUM_EDEFAULT;

	/**
	 * The default value of the '{@link #getSnapInterval() <em>Snap Interval</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSnapInterval()
	 * @generated
	 * @ordered
	 */
	protected static final int SNAP_INTERVAL_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getSnapInterval() <em>Snap Interval</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSnapInterval()
	 * @generated
	 * @ordered
	 */
	protected int snapInterval = SNAP_INTERVAL_EDEFAULT;

	/**
	 * The default value of the '{@link #getTickInterval() <em>Tick Interval</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTickInterval()
	 * @generated
	 * @ordered
	 */
	protected static final int TICK_INTERVAL_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getTickInterval() <em>Tick Interval</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTickInterval()
	 * @generated
	 * @ordered
	 */
	protected int tickInterval = TICK_INTERVAL_EDEFAULT;

	/**
	 * The default value of the '{@link #isLiveDragging() <em>Live Dragging</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isLiveDragging()
	 * @generated
	 * @ordered
	 */
	protected static final boolean LIVE_DRAGGING_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isLiveDragging() <em>Live Dragging</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isLiveDragging()
	 * @generated
	 * @ordered
	 */
	protected boolean liveDragging = LIVE_DRAGGING_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected HSliderImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return RiaPackage.Literals.HSLIDER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getMinimum() {
		return minimum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMinimum(int newMinimum) {
		int oldMinimum = minimum;
		minimum = newMinimum;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, RiaPackage.HSLIDER__MINIMUM, oldMinimum, minimum));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getMaximum() {
		return maximum;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMaximum(int newMaximum) {
		int oldMaximum = maximum;
		maximum = newMaximum;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, RiaPackage.HSLIDER__MAXIMUM, oldMaximum, maximum));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getSnapInterval() {
		return snapInterval;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSnapInterval(int newSnapInterval) {
		int oldSnapInterval = snapInterval;
		snapInterval = newSnapInterval;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, RiaPackage.HSLIDER__SNAP_INTERVAL, oldSnapInterval, snapInterval));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getTickInterval() {
		return tickInterval;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTickInterval(int newTickInterval) {
		int oldTickInterval = tickInterval;
		tickInterval = newTickInterval;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, RiaPackage.HSLIDER__TICK_INTERVAL, oldTickInterval, tickInterval));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isLiveDragging() {
		return liveDragging;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLiveDragging(boolean newLiveDragging) {
		boolean oldLiveDragging = liveDragging;
		liveDragging = newLiveDragging;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, RiaPackage.HSLIDER__LIVE_DRAGGING, oldLiveDragging, liveDragging));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case RiaPackage.HSLIDER__MINIMUM:
				return getMinimum();
			case RiaPackage.HSLIDER__MAXIMUM:
				return getMaximum();
			case RiaPackage.HSLIDER__SNAP_INTERVAL:
				return getSnapInterval();
			case RiaPackage.HSLIDER__TICK_INTERVAL:
				return getTickInterval();
			case RiaPackage.HSLIDER__LIVE_DRAGGING:
				return isLiveDragging();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case RiaPackage.HSLIDER__MINIMUM:
				setMinimum((Integer)newValue);
				return;
			case RiaPackage.HSLIDER__MAXIMUM:
				setMaximum((Integer)newValue);
				return;
			case RiaPackage.HSLIDER__SNAP_INTERVAL:
				setSnapInterval((Integer)newValue);
				return;
			case RiaPackage.HSLIDER__TICK_INTERVAL:
				setTickInterval((Integer)newValue);
				return;
			case RiaPackage.HSLIDER__LIVE_DRAGGING:
				setLiveDragging((Boolean)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case RiaPackage.HSLIDER__MINIMUM:
				setMinimum(MINIMUM_EDEFAULT);
				return;
			case RiaPackage.HSLIDER__MAXIMUM:
				setMaximum(MAXIMUM_EDEFAULT);
				return;
			case RiaPackage.HSLIDER__SNAP_INTERVAL:
				setSnapInterval(SNAP_INTERVAL_EDEFAULT);
				return;
			case RiaPackage.HSLIDER__TICK_INTERVAL:
				setTickInterval(TICK_INTERVAL_EDEFAULT);
				return;
			case RiaPackage.HSLIDER__LIVE_DRAGGING:
				setLiveDragging(LIVE_DRAGGING_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case RiaPackage.HSLIDER__MINIMUM:
				return minimum != MINIMUM_EDEFAULT;
			case RiaPackage.HSLIDER__MAXIMUM:
				return maximum != MAXIMUM_EDEFAULT;
			case RiaPackage.HSLIDER__SNAP_INTERVAL:
				return snapInterval != SNAP_INTERVAL_EDEFAULT;
			case RiaPackage.HSLIDER__TICK_INTERVAL:
				return tickInterval != TICK_INTERVAL_EDEFAULT;
			case RiaPackage.HSLIDER__LIVE_DRAGGING:
				return liveDragging != LIVE_DRAGGING_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (minimum: ");
		result.append(minimum);
		result.append(", maximum: ");
		result.append(maximum);
		result.append(", snapInterval: ");
		result.append(snapInterval);
		result.append(", tickInterval: ");
		result.append(tickInterval);
		result.append(", liveDragging: ");
		result.append(liveDragging);
		result.append(')');
		return result.toString();
	}

} //HSliderImpl
